package com.eastcom.collection.tools.file;

import javax.xml.bind.annotation.adapters.XmlAdapter;
import java.text.SimpleDateFormat;
import java.util.Date;

public class JaxbJavaUtilDateSerializer extends XmlAdapter<String, Date>{  

	private SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy");  

	@Override  
	public String marshal(Date date) throws Exception {  
		return dateFormat.format(date);  
	}  

	@Override  
	public Date unmarshal(String date) throws Exception {  
		return dateFormat.parse(date);  
	}  
} 